function pipei(temp) {
    let boll = false
    for (let i = 0; i < temp.length; i++) {
        if ((temp[i] >= 'A' && temp[i] <= 'Z') || (temp[i] >= 'a' && temp[i] <= 'z') || (temp[i] >= '0' && temp[i] <= '9')) {
            boll = true
        }
        else {
            boll = false
        }
    }
    return boll
}
const sumbit = document.querySelector('.sumbit')
sumbit.addEventListener('click', function () {
    let username_value = false
    let password_value = false
    let username = document.querySelector('#username')
    let password = document.querySelector('#password')
    let email = document.querySelector('#email')
    password = password.value
    username = username.value
    email = email.value
    if (username.length == 11 && pipei(username)) {
        username_value = true
    }
    if (password.length >= 8 && pipei(password)) {
        password_value = true
    }
    if (username_value && password_value) {
        alert("注册成功")
        // setTimeout(3000)
        window.location.href = 'file:///E:/%E6%A1%8C%E9%9D%A2/javascript%E8%AE%BE%E8%AE%A1/denglu.html';
        localStorage.setItem('uname', `${username}`)
        localStorage.setItem('password', `${password}`)
        localStorage.setItem('email', `${email}`)
        location.href = 'denglu.html'
    }
    else {
        alert("用户名或密码格式错误")
    }

})